from fabric2.config import Config as Fabric2Config
from invoke.config import merge_dicts
from .remote import Remote


class Config(Fabric2Config):

    def __init__(self, *args, **kwargs):
        super(Config, self).__init__(*args, **kwargs)

    @staticmethod
    def global_defaults():
        defaults = Fabric2Config.global_defaults()
        ours = {
            "run": {"replace_env": True, "encoding": "utf-8"},
            "runners": {"remote": Remote}
        }
        merge_dicts(defaults, ours)
        return defaults


